<%--
  Created by IntelliJ IDEA.
  User: John.C
  Date: 2018/11/29
  Time: 15:59
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <link rel="stylesheet" href="/css/list.css">
    <title>员工名单</title>
</head>
<body>
<article>
    <div class="search">
        <form action="/entrance/list">
            <label for="number">工号</label><span><input type="text" name="number" id="number"
                                                       value=""/></span>
            <label for="name">姓名</label><span><input type="text" name="name" id="name"
                                                            value=""/></span>
            <input type="submit" class="btn" value="查找员工"/>
            <a href="/entrance/toadd" class="add">新增员工</a>
        </form>
    </div>
    <section>
        <div>
            <table>
                <tr>
                    <td>工号</td>
                    <td>姓名</td>
                    <td>性别</td>
                    <td>年龄</td>
                    <td>职务</td>
                    <td>入职时间</td>
                </tr>
                <c:forEach items="${stuffPage}" var="query">
                    <tr>
                        <td>${query.number}</td>
                        <td>${query.name}</td>
                        <td>${query.gender}</td>
                        <td>${query.age}</td>
                        <td>${query.jobType}</td>
                        <td>${query.entryTime}</td>
                        <td><a href="/entrance/delete?id=${query.id}">删除</a>|<a href="/entrance/toupdate?id=${query.id}">修改</a></td>
                    </tr>
                </c:forEach>
            </table>
        </div>
        <!--分页部分-->
        <div class="pageDepart">
            <ul>
                <li class="first"><a href="#">首页</a></li>
                <c:if test="${page.page > 1}">
                    <li class="prv"><a href="/entrance/list?number=${find.number}&name=${find.name}&curntPg=${page.curntPg - 1}&count=${page.count}">上一页</a></li>
                </c:if>
                <c:forEach begin="1" end="${page.pageAmount}" var="index">
                    <li <c:if test="${page.curntPg == index }"> class="current"</c:if> ><a href="/entrance/list?number=${find.number}&name=${find.name}&curntPg=${index}&count=${page.count}">${index}</a></li>
                </c:forEach>
                <c:if test="${page.page < page.pageAmount}">
                    <li class="next"><a href="/entrance/list?number=${find.number}&name=${find.name}&curntPg=${page.curntPg + 1}&count=${page.count}">下一页</a></li>
                </c:if>
                <li class="last"><a href="#">最后一页</a></li>
                <li class="total"><span>总共 ${page.pageAmount} 页</span></li>
            </ul>
        </div>
    </section>
    <aside>
        <p>常见问题</p>
        <p>
            已经签了合同，为什么公司的员工名单没有我？
        </p>
        <p>
            人事部偷懒了，扁负责人一顿就好(` _ `)
        </p>
    </aside>
</article>
</body>
</html>